package commands;

import IA.InformationAggregator;

/**
 *
 * @author Christopher
 */
public class CmdAddItemComment extends Command {
    private String commentStr;
    
    public CmdAddItemComment(InformationAggregator ia, String commentStr){
        super(ia);
        this.commentStr = commentStr;
    }
    
    @Override
    public Object execute(){
        String delimiter = "/";
        String[] ary;
        String comment;
        Integer index;
        
        ary = commentStr.split(delimiter);
        index = Integer.parseInt(ary[0]);
        comment = ary[1];
        ia.getMenu().addComment(index, comment);
        
        return null;
    }
}
